<script type="text/javascript">
$(function(){
	$.get("applicationDefinition/getAppKindName",function(data) {
		var content = "<option value=''>请选择</option>";
		$(data).each(function(n, item) {
			for (i = 0; i < item.sdd.length; i++) {
				content += "<option value="+item.sdd[i].appKindId+">"
						   + item.sdd[i].appKindName
						   + "</option>"
				}
			$("#appClassifyByAddNew").html(content);
			$.get("applicationDefinition/getActiveUserInfo",function(data){
				var activeUser = data.activeUser;
				$("#crtOperatorByAddNew").val(activeUser.userNo);
				$("#lastOperator").val(activeUser.userNo);
			},"json");
			$.post("applicationDefinition/getAppKindInfoByModify",getAppKindInfoByModify,"json");
			var curDate = new Date().format("yyyy-MM-dd");
			$("#crtDateByAddNew").val(curDate);
			$("#lastModDate").val(curDate);
		});
	}, "json"); 
	$("#appClassifyByAddNew").on("change",function(){
		loadAppFlag();
	});
	/* $("#checkAppName").click(function(){
		var appName = $("#appKindNameByAddNew").val();
		var flag = false;
		$.post("applicationDefinition/queryAppKindInfoByAppName",{"appName":appName},function(data){
			if(data.checkName>0){
				alertMsg.warn("该应用名称已存在，请重新输入！");
				flag =true;
			}
		},"json");
		return flag;
	}); */
	
})
</script>
<div class="pageContent">
	<form id="submitAppKind" method="post" action="applicationDefinition/addAppDefToDB" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone);">
		<div class="pageFormContent" layoutH="48">
			<p>
				<label>应用名称：</label>
				<input id="appKindNameByAddNew" name="appName" size="20" maxlength="30" class="validRequired" />	
			</P>
			<p>
				<label>应用分类：</label>
				<select id="appClassifyByAddNew" name="appKindId"  class="validRequired" >
				</select>			
			</P>
			<p>
				<label>应用类型状态：</label>
				<select id="appTypeStatusByAddNew" name="isActivate"  class="validRequired" >
					<option value='0'>无效</option>
					<option value='1'>有效</option>
				</select>			
			</P>
			<p>
				<label>有效期月数：</label>
				<select id="validMonthByAddnew" name="validMonthNum"  class="validRequired" >
					<option value=''>请选择</option>
					<option value='1'>1</option>
					<option value='3'>3</option>
					<option value='6'>6</option>
					<option value='12'>12</option>
					<option value='24'>24</option>
				</select>
			</P>
			<p>
				<label>是否需要年检：</label>
				<select id="isAnnualByAddNew" name="isAnnual"  class="validRequired" >
					<option value='0'>不需要</option>
					<option value='1'>需要</option>
				</select>			
			</P>			
			<p>
				<label>是否可停用：</label>
				<select id="allowDisableByAddNew" name="allowDisable" class="validRequired" >
				    <option value='0'>不可停用</option>
					<option value='1'>可停用</option>
				</select>	
			</P>
			<p>
				<label>应用标识：</label>
				<select id="appFlagByAddNew" name="appFlag" class="validRequired" >
					<!-- <option value=''>请选择</option>
				    <option value='3F01'>3F01</option>
					<option value='M1BK'>M1BK</option> -->
				</select>	
			</P>
			<p>
				<label>年审提前天数：</label>
				<select id="annualAheadDays" name="annualAheadDays">
					<option value=''>请选择</option>
					<option value='7'>7</option>
					<option value='15'>15</option>
					<option value='30'>30</option>
					<option value='60'>60</option>
				</select>	
			</P>
			<p>
				<label>创建柜员号：</label>
				<input id="crtOperatorByAddNew" name="crtOperator"  readonly="readonly">
			</P>
			<p>
				<label>创建日期：</label>
				<input id="crtDateByAddNew" name="crtDate"  readonly="readonly">
			</P>
			<p>
				<label>最后修改柜员：</label>
				<input id="lastOperator" name="lastOperator" size="20" readonly="readonly" />	
			</P>
			<p>
				<label>最后修改日期：</label>
				<input id="lastModDate" name="lastDate" size="20" readonly="readonly" />	
			</P>
			<p>
				<label>备注：</label>
				<textarea  id="descriptionByAddNew" name="remark" rows="3" cols="40" maxlength="30"></textarea>
			</P>
			<p>
				<input id="appTypeByAddNew" name="appType" type="hidden" value=""/>
			</P>	
		</div>
		<div class="formBar">
			<ul> 
				<li>
				<div class="buttonActive"><div class="buttonContent"><button id="submitAppBut" type="submit" class="valid">提交</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>